const controller = getAjaxBaseUrl('/reportUserSubsidiary', '/energy')

/** 查询所有可配置的企业 */
export async function loadEnterpriseOfReportUser() {
  return get(`${controller}/getReportSubsidiary`)
}

/** 查询用户绑定的企业 */
export async function loadSelectedEnterpriseOfReportUser(userId: number) {
  return get(`${controller}/getBindSubsidiary?userId=${userId}`)
}

/** 保存用户绑定企业 */
export async function saveReportUserSubsidiary(
  userId: number,
  code: string,
) {
  return get(`${controller}/bindSubsidiary?userId=${userId}&socialCreditCodes=${code}`)
}
